package exercise3;

import java.util.Scanner;

public class Exercise06_03 {
    public static void main(String []args)
    {
        System.out.println("请输入一个整数： ");
        Scanner input=new Scanner(System.in);
        int num=input.nextInt();
        if (isPalindrome(num))
        {
            System.out.println("是回文数");
        }
        else {
            System.out.println("不是回文数");
        }
    }
    public static boolean isPalindrome(int number) {
        return number == reverse(number);
    }
    public static int reverse(int number) {
        int result = 0;
        while (number != 0) {
            int remainder = number % 10;

            result = result * 10 + remainder;

            number = number / 10;
        }

        return result;
    }
}
